package com.nbst.annotation;

import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

@Aspect
@Component
@Slf4j
public class LogImp {
    @Around("@annotation(com.nbst.annotation.Log)")
    public void around(ProceedingJoinPoint joinPoint){
        log.info("执行前1111");
        try {
            joinPoint.proceed();
        }catch (Exception e){

        } catch (Throwable throwable) {
            throwable.printStackTrace();
        }
        log.info("执行后22222");
    }
}
